<?php require './view/public/header.php'; ?>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="result-wrap">
            <div class="result-content">
                <form action="./index.php?c=goods&a=doedit<?php echo "&id=$_GET[id]&nowPage=$_GET[nowPage]";?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
						<tr>
                            <th><i class="require-red">*</i>商品名：</th>
                            <td>
                                <input class="common-text required" id="title" name="gname" size="50" value="<?php if(isset($ret['gname'])) echo $ret['gname']; ?>" type="text">
                            </td>
                        </tr>
						 <tr>
                            <th width="120"><i class="require-red">*</i>类别：</th>
                            <td>
                                <select name="tid" id="catid" class="required">
								<option value="0">根分类</option>
									<?php
										foreach($types as $v){
											$s = '';
											if($ret['tid']==$v['tid']){$s = 'selected';}
											echo "<option $s value='$v[tid]'>$v[tname]</option>";
										}
									?>
                                </select>
                            </td>
                        </tr>
						<tr>
                            <th><i class="require-red">*</i>价格：</th>
                            <td>
                                <input class="common-text required" id="title" name="price" size="50" value="<?php if(isset($ret['price'])) echo $ret['price']; ?>" type="number">
                            </td>
                        </tr>
						<tr>
                            <th><i class="require-red">*</i>库存：</th>
                            <td>
                                <input class="common-text required" id="title" name="cnt" size="50" value="<?php if(isset($ret['cnt'])) echo $ret['cnt']; ?>" type="number">
                            </td>
                        </tr>
						<tr>
                            <th><i class="require-red">不可修改</i>畅销量：</th>
                            <td>
                                <input class="common-text required" disabled id="title" name="scnt" size="50" value="<?php if(isset($ret['scnt'])) echo $ret['scnt']; ?>" type="text">
                            </td>
                        </tr>
						<tr>
                            <th><i class="require-red">不可修改</i>浏览量：</th>
                            <td>
                                <input class="common-text required" disabled id="title" name="vcnt" size="50" value="<?php if(isset($ret['vcnt'])) echo $ret['vcnt']; ?>" type="text">
                            </td>
                        </tr>
						<tr>
                            <th>图片：</th>
                            <td>
                                <input accept="image/gif,image/jpeg,image/png" name="gpic" value="" type="file">
                            </td>
                        </tr>
						<tr>
								<th>描述：</th>
								<td><textarea name="gdesc" rows="5" cols="30"><?php if(isset($ret['gdesc'])) echo $ret['gdesc']; ?></textarea></td>
						</tr>
                            
							<tr>
                                <th><i class="require-red">*</i>状态</th>
                                <td>
									<input class="common-text required" id="title" name="status" size="50" <?php if(isset($ret['status']) && $ret['status']==1) echo 'checked'; ?> value="1" type="radio">上架
									<input class="common-text required" id="title" name="status" size="50" <?php if(isset($ret['status']) && $ret['status']==0) echo 'checked'; ?> value="0" type="radio">下架
                                </td>
                            </tr>
                                <input  name="ctime"  value="<?php echo time(); ?>" type="hidden" />
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>
    </div>
    <!--/main-->
<?php require './view/public/footer.php'; ?>